forked from containers/libkrun
-
Notifications
You must be signed in to change notification settings - Fork 0
Test2 Multiport console v3 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mtjhrc
wants to merge
8
commits into
main
Choose a base branch
from
multiport-console-v3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26a295d to
938aae9
Compare
Signed-off-by: Matej Hrica <[email protected]>
This makes the device act as a multiport console. This doesn't introduce new functionality, the number of ports remains fixed at 1 port (for the terminal with stdin/stdout). Signed-off-by: Matej Hrica <[email protected]>
938aae9 to
38ffaed
Compare
Signed-off-by: Matej Hrica <[email protected]>
12c8689 to
630c0cd
Compare
This is done by creating a port for each of stdin/stdout/stderr, Each of these ports is multidirectional but we only use one direction. Port 0 must always be a console - this is implied by the specification. Signed-off-by: Matej Hrica <[email protected]>
1cbe806 to
c14f41f
Compare
When we redirect the stdout of the guest it opens the question, where should init/kernel messages (things written to the console) go. It seems to make sense to write it as errors to the log, because for now the only messages that go there are errors. Signed-off-by: Matej Hrica <[email protected]>
This works by writing ascii 'ETX' into the guest console on SIGINT. This curently only works when the guest input is redirected (otherwise pressing ^C should work, but SIGINT to the host libkrun process won't work. Furthermore init process needs to fork itself, because pid 1 cannot receive SIGINT signal, unless it instals a handler, but we cannot expect all programs to do that. Signed-off-by: Matej Hrica <[email protected]>
We should wait until the output currently in the queue of the guest is written and only then exit the libkrun process. This fixes an issue where you would sometimes not get the full output of a program inside the vm (we would call exit sooner, than we finished all the writes). Signed-off-by: Matej Hrica <[email protected]>
c14f41f to
e0bccea
Compare
Signed-off-by: Matej Hrica <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.